class Trace
	include DataMapper::Resource
	include MatrixHelpers::DM

	property :id,   Serial
	property :name, String
	property :description, Text
	property :due, DateTime
	property :finished_at, DateTime
	property :created_at, DateTime
	property :check_point, Boolean, :default => false

	belongs_to :tasklet, :required => true
	belongs_to :user, :required => true

	def finished?
		true if finished_at
	end

	def overdue?
		true if check_point and due and ((finished_at || DateTime.now) > due)
	end
end

